//Sighting object for displaying all icons pertaining to UFO sightings.
//Each sighting has a different "type" (eg. cone, circle, ect.) which determines the shape/color of the icon.

public class Sighting extends Icon {

	int type;		//Type number of UFO (shape category)
	float lat;		//Latitude
	float lon;		//Longitude
	String city;
	String state;
	String args[];
	
	public Sighting(float _x, float _y, float w, float h, int t) {
		x = _x;
		y = _y;
		width = w;
		height = h;
		type = t;
	}
	
	public Sighting(float _x, float _y, float w, float h, int t, String _args[]) {
		x = _x;
		y = _y;
		width = w;
		height = h;
		type = t;
		args = _args;
	}
	
	public void draw() {
		drawShape();
		
		//Draw info during mouse-over
		if(mouseOver()) {
			GLOBAL.isInfoShowingS = true;
			drawInfoBox(args);	
		}
	}
	
	//Draw appropriate shape/color for sighting based on type number
	private void drawShape() {
		GLOBAL.processing.stroke(150);
		
		switch(type) {
		//Other/Changing
		case 1:	GLOBAL.processing.fill(GLOBAL.colorOther, GLOBAL.alpha);
				GLOBAL.processing.rect(x, y, width, height);
				break;
		//Light-Based
		case 2:	GLOBAL.processing.fill(GLOBAL.colorLight, GLOBAL.alpha);
				GLOBAL.processing.quad(x, y, 
										x+((width+GLOBAL.adjust)/2), y+((height+GLOBAL.adjust)/2), 
										x, y+(height+GLOBAL.adjust), x-((width+GLOBAL.adjust)/2), y+((height+GLOBAL.adjust)/2));
				width += GLOBAL.adjust;
				height += GLOBAL.adjust;
				break;
				//GLOBAL.processing.triangle(x, y, (x+width)/2, y+height, x+width, y);
		//Triangle-Based
		case 3:	GLOBAL.processing.fill(GLOBAL.colorTriangle, GLOBAL.alpha);
				GLOBAL.processing.triangle(x, y, 
											x+width+GLOBAL.adjust, y, 
											x+((width+GLOBAL.adjust)/2), y-height);
				width += GLOBAL.adjust;
				height += GLOBAL.adjust;
				break;
		//Rectangle-Based
		case 4:	GLOBAL.processing.fill(GLOBAL.colorRect, GLOBAL.alpha);
				GLOBAL.processing.rect(x, y, width, height);
				break;
		//Circle-Based
		case 5:	GLOBAL.processing.fill(GLOBAL.colorCircle, GLOBAL.alpha);
				GLOBAL.processing.ellipse(x, y, width, height);
				break;
		//Unknown
		default: GLOBAL.processing.fill(GLOBAL.colorUnknown, GLOBAL.alpha);
				 GLOBAL.processing.ellipse(x, y, width, height);
				 break;
		}
		
		GLOBAL.processing.noStroke();
	}
	
}
